const PREFIX = 'live_'
const LiveActionType = {
  teacher_leave: PREFIX + 'teacher_leave',
  live_pause: PREFIX + 'live_pause',
  init_swiper: PREFIX + 'init_images',
  change_index: PREFIX + 'change_index',
  add_image: PREFIX + 'add_images',
  change_voice_status: PREFIX + 'change_voice_status',
  change_video_mask: PREFIX + 'change_video_mask'
}

const toggleTeacherLeave = (leave) => {
  return {
    type: LiveActionType.teacher_leave,
    leave: leave
  }
}
const toggleVideoMask = (show)=> {
  return {
    type: LiveActionType.change_video_mask,
    show: show
  }
}
const toggleLivePause = (pause) => {
  return {
    type: LiveActionType.live_pause,
    pause: pause
  }
}
const initSwiper = (images, index) => {
  return {
    type: LiveActionType.init_swiper,
    images: images,
    index: index
  }
}
const changeIndex = (index) => {
  return {
    type: LiveActionType.change_index,
    index: index
  }
}
const addImage = (image) => {
  return {
    type: LiveActionType.add_image,
    image: image
  }
}
const changeVoiceStatus = (status) => {
  return {
    type: LiveActionType.change_voice_status,
    status: status
  }
}

module.exports = {
  LiveActionType,
  toggleLivePause,
  toggleTeacherLeave,
  initSwiper,
  changeIndex,
  addImage,
  changeVoiceStatus,
  toggleVideoMask
}
